﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractDetail.aspx.cs"
    Inherits="ATW.MT.SellManage.ContractDetail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>合同明细</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <script type="text/javascript" src="../Scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../Scripts/jsharp.popupdiv.js"></script>
    <link rel="Stylesheet" href="../Styles/css.css" />
    <base target="_self" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="content" style="width: 100%; max-height: 500px; overflow-y: scroll;">
    </div>
    <div style="margin-top: 15px; text-align: center">
        <input type="button" value="关闭" onclick="window.close()" class="queryButton" />
        <a id="btnDown" style="text-decoration: none" href="#" class="queryButton">下载</a>
    </div>
    <asp:HiddenField runat="server" ID="hdfCid" />
    <script type="text/javascript">
        $(function () {
            var cid = $('[id$="hdfCid"]').val();
            $.get("../SellManage/ContractDetail.aspx", {
                handler: 'getContent',
                cid: cid,
                r: Math.random()
            }, function (data) {
                $('#content').html(data);
                $.get("../SellManage/ContractDetail.aspx", {
                    handler: "getUrl",
                    cid: cid,
                    r: Math.random()
                }, function (data) {
                    if (data == "") {
                        $("#btnDown").click(function () {
                            alert("未找到对应的PDF文件！");
                        })
                    }
                    else {
                        $("#btnDown").attr("href", data);
                    }
                })
            })
        })
    </script>
    </form>
</body>
</html>
